package jwd.page.corp

import android.annotation.SuppressLint
import android.databinding.DataBindingUtil
import android.os.Bundle
import android.view.View
import jwd.base.BaseFragment
import jwd.model.corp.CorpFetureGroup
import jwd.pzx.R
import jwd.pzx.databinding.ActivityCorpBinding
import android.databinding.*
import jwd.base.JsonMap
import jwd.base.StringMap
import jwd.util.Ajax
import kotlinx.android.synthetic.main.activity_corp.*
import java.util.Map

/**
 * Created by udi on 17-7-31.
 */


class CorpFragment @SuppressLint("ValidFragment")
constructor(var data: ObservableArrayList<CorpFetureGroup> = ObservableArrayList()) : BaseFragment(R.layout.activity_corp) {

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)

    }


    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)


        InitData()
    }

    private fun InitData() {
        var d = DataBindingUtil.bind<ActivityCorpBinding>(view)
        d.feature = data

        button1.setOnClickListener {
            Ajax("/hi").doGet<JsonMap> {
                alert((it["data"]  as Map<String, *>)["profiles"].toString())
            }
        }
    }
}
